#ifndef QDRIVEVALUEMAP_H
#define QDRIVEVALUEMAP_H

#include "shared_global.h"
#include <QString>
#include <QObject>

#include <QList>
#include <QStringList>

class SHAREDSHARED_EXPORT QHeaderInfo: public QObject
{
    Q_OBJECT
public:
    QHeaderInfo(const QString &text);

};

class SHAREDSHARED_EXPORT QDriveValueMap : public QObject
{
    Q_OBJECT
public:
    QDriveValueMap();

    void    addHeader(QHeaderInfo* info);
    void    insertHeader(int index,QHeaderInfo *info);
    void    removeHeader(const QString &text);
    QHeaderInfo *header(int column);

    QList<QHeaderInfo*> headers();
    QList<QStringList>  values();

    void    setValue(int row,int column,const QString &value);
    QString value(int row,int column);
    void    addRow();
    void    removeRow(int row);

    int     rowCount();
    int     columnCount();
    int     column(const QString &text);
signals:
    void    valueChanged(int row,int column,const QString &value);
    void    changed();
protected:
    QList<QHeaderInfo*> m_headList;
    QList<QStringList>  m_valueMap;
};

#endif // QDRIVEVALUEMAP_H
